<?php
session_start();

if (isset($_GET['op'])){
    $_SESSION['openid']=$_GET['op'];
}
$openid='';
if (isset($_SESSION['openid'])){
	$openid=$_SESSION['openid'];
}
if (empty($openid)){
	exit;
}
$qian=['hcbp','nffp','snyq','xxsc','yzjl','zsty'];
shuffle($qian);
 
$cdnUrl='https://lin.mei94.com/hisense/';

$appId = 'wxe214ac48790c622f';
$secret = '62d3091e10b72a50a8a2c4f758a799b2';
include 'jssdk.php';
$jssdk = new JSSDK($appId, $secret);
$signPackage = @$jssdk->GetSignPackage();

?><!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>新年摇福签，元宝抱回家</title>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<style>
html,body{width:100%;font-size:12px;font-family:Helvetica,Tahoma, Arial, STXihei,Microsoft YaHei, Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;}
body{background:#d23c3b;-webkit-overflow-scrolling: touch;overflow-scrolling: touch;overflow-y: scroll;}
body, div{padding:0px;margin:0px auto;max-width:750px;}
.weui-dialog{position:fixed;z-index:5000;width:80%;max-width:300px;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);background-color:#FFF;text-align:center;border-radius:3px;overflow:hidden}.weui-dialog__hd{padding:1.3em 1.6em .5em}.weui-dialog__title{font-weight:400;font-size:36px}.weui-dialog__bd{padding:0 1.6em .8em;min-height:40px;font-size:15px;line-height:1.3;word-wrap:break-word;word-break:break-all;color:#999}.weui-dialog__bd:first-child{padding:1.2em 20px .1em;color:#353535}.weui-dialog__ft{position:relative;line-height:48px;font-size:18px;display:-webkit-box;display:-webkit-flex;display:flex}.weui-dialog__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1px solid #D5D5D6;color:#D5D5D6;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-dialog__btn{display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:#3CC51F;text-decoration:none;-webkit-tap-highlight-color:transparent;position:relative}.weui-dialog__btn:active{background-color:#EEE}.weui-dialog__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1px solid #D5D5D6;color:#D5D5D6;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.5);transform:scaleX(.5)}.weui-dialog__btn:first-child:after{display:none}.weui-dialog__btn_default{color:#353535}.weui-dialog__btn_primary{color:#0BB20C}@media screen and (min-width:1024px){.weui-dialog{width:35%}}.weui-mask{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0;background:rgba(0,0,0,.6)}
.weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}
.js_dialog{display:none;}
-webkit-touch-callout:none;
-webkit-user-select:none;
html{-ms-touch-action:none;}
div,img{-webkit-tap-highlight-color:rgba(0,0,0,0);}
*{-webkit-text-size-adjust: none;}
.simg{position:absolute;display:block;}
a{text-decoration:none;}
.txt{position:absolute;text-indent:4px;color:#787c7f;font-size:12px;z-index:2;border:none;background:transparent;}
.txt::-webkit-input-placeholder{text-align:left;color:#a2a2a2;}
input {border:0;outline: none;background-color: rgba(0, 0, 0, 0);font-size:12px;}
select{position:absolute;color:#787c7f;display:block;background:transparent;border:0px;text-indent:4px;font-size:12px;-webkit-appearance:none;}
.container{position:relative;width:100%;height:auto;}
.page{position:absolute;width:100%;height:100%;display:none;}
.p1{position:absolute;width:100%;height:100%;opacity:0;}
.p2-qr, .p3-qr{position:absolute;width:100%;height:100%;opacity:0;}
.p-b, .thebg, .p2-ren, .p3-bao{position:absolute;width:100%;top:0;left:0;}
.thebg{overflow:hidden;}
.p3-bao{z-index:4;}
.animated{animation-duration: 1s;animation-fill-mode: both;}
.animatedf{animation-duration: 1.2s;animation-fill-mode: both;}
.animated2{animation-duration: 6s;animation-fill-mode: both;animation-iteration-count: infinite;}
.animated3{animation-duration: 7s;animation-fill-mode: both;animation-iteration-count: infinite;}
.animated4{animation-duration: 7.1s;animation-fill-mode: both;animation-iteration-count: infinite;}
.animated.infinite{animation-iteration-count: infinite;}
.animated.delay-1s {animation-delay: 1s;}
@-webkit-keyframes swing2{20%{-webkit-transform:rotate3d(0,0,1,1deg);transform:rotate3d(0,0,1,1deg)}40%{-webkit-transform:rotate3d(0,0,1,-.5deg);transform:rotate3d(0,0,1,-.5deg)}60%{-webkit-transform:rotate3d(0,0,1,.2deg);transform:rotate3d(0,0,1,.2deg)}80%{-webkit-transform:rotate3d(0,0,1,-.2deg);transform:rotate3d(0,0,1,-.2deg)}to{-webkit-transform:rotate3d(0,0,1,0deg);transform:rotate3d(0,0,1,0deg)}}@keyframes swing2{20%{-webkit-transform:rotate3d(0,0,1,1deg);transform:rotate3d(0,0,1,1deg)}40%{-webkit-transform:rotate3d(0,0,1,-.5deg);transform:rotate3d(0,0,1,-.5deg)}60%{-webkit-transform:rotate3d(0,0,1,.2deg);transform:rotate3d(0,0,1,.2deg)}80%{-webkit-transform:rotate3d(0,0,1,-.2deg);transform:rotate3d(0,0,1,-.2deg)}to{-webkit-transform:rotate3d(0,0,1,0deg);transform:rotate3d(0,0,1,0deg)}}.swing2{-webkit-transform-origin:top center;transform-origin:top center;-webkit-animation-name:swing2;animation-name:swing2}
@-webkit-keyframes pulse{from{-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}
50%{-webkit-transform:scale3d(1.05,1.05,1.05);transform:scale3d(1.05,1.05,1.05)}
to{-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}
}
@keyframes pulse{from{-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}
50%{-webkit-transform:scale3d(1.05,1.05,1.05);transform:scale3d(1.05,1.05,1.05)}
to{-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}
}
.pulse{-webkit-animation-name:pulse;animation-name:pulse}
@-webkit-keyframes tada{from{-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}
10%,20%{-webkit-transform:scale3d(.9,.9,.9) rotate3d(0,0,1,-3deg);transform:scale3d(.9,.9,.9) rotate3d(0,0,1,-3deg)}
30%,50%,70%,90%{-webkit-transform:scale3d(1.1,1.1,1.1) rotate3d(0,0,1,3deg);transform:scale3d(1.1,1.1,1.1) rotate3d(0,0,1,3deg)}
40%,60%,80%{-webkit-transform:scale3d(1.1,1.1,1.1) rotate3d(0,0,1,-3deg);transform:scale3d(1.1,1.1,1.1) rotate3d(0,0,1,-3deg)}
to{-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}
}
@keyframes tada{from{-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}
10%,20%{-webkit-transform:scale3d(.9,.9,.9) rotate3d(0,0,1,-3deg);transform:scale3d(.9,.9,.9) rotate3d(0,0,1,-3deg)}
30%,50%,70%,90%{-webkit-transform:scale3d(1.1,1.1,1.1) rotate3d(0,0,1,3deg);transform:scale3d(1.1,1.1,1.1) rotate3d(0,0,1,3deg)}
40%,60%,80%{-webkit-transform:scale3d(1.1,1.1,1.1) rotate3d(0,0,1,-3deg);transform:scale3d(1.1,1.1,1.1) rotate3d(0,0,1,-3deg)}
to{-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}
}
.tada{-webkit-animation-name:tada;animation-name:tada}
@-webkit-keyframes flipInY{from{-webkit-transform:perspective(400px) rotate3d(0,1,0,90deg);transform:perspective(400px) rotate3d(0,1,0,90deg);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in;opacity:0}
40%{-webkit-transform:perspective(400px) rotate3d(0,1,0,-20deg);transform:perspective(400px) rotate3d(0,1,0,-20deg);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}
60%{-webkit-transform:perspective(400px) rotate3d(0,1,0,10deg);transform:perspective(400px) rotate3d(0,1,0,10deg);opacity:1}
80%{-webkit-transform:perspective(400px) rotate3d(0,1,0,-5deg);transform:perspective(400px) rotate3d(0,1,0,-5deg)}
to{-webkit-transform:perspective(400px);transform:perspective(400px)}
}
@keyframes flipInY{from{-webkit-transform:perspective(400px) rotate3d(0,1,0,90deg);transform:perspective(400px) rotate3d(0,1,0,90deg);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in;opacity:0}
40%{-webkit-transform:perspective(400px) rotate3d(0,1,0,-20deg);transform:perspective(400px) rotate3d(0,1,0,-20deg);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}
60%{-webkit-transform:perspective(400px) rotate3d(0,1,0,10deg);transform:perspective(400px) rotate3d(0,1,0,10deg);opacity:1}
80%{-webkit-transform:perspective(400px) rotate3d(0,1,0,-5deg);transform:perspective(400px) rotate3d(0,1,0,-5deg)}
to{-webkit-transform:perspective(400px);transform:perspective(400px)}
}
.flipInY{-webkit-backface-visibility:visible!important;backface-visibility:visible!important;-webkit-animation-name:flipInY;animation-name:flipInY}
@keyframes fuLeft{
  0%{transform: translate3d(-300px,0,0);opacity:0;}
  99%{transform: translate3d(0, 0,0);opacity:1;}
  100%{transform: translate3d(0, 0,0);opacity:0;}
}
.fuLeft {
  -webkit-backface-visibility: visible !important;
  backface-visibility: visible !important;
  -webkit-animation-name: fuLeft;
  animation-name: fuLeft;
}
@keyframes fuRight{
  0%{transform: translate3d(300px,0,0);opacity:0; }
  99%{transform: translate3d(0, 0,0);opacity:1;}
  100%{transform: translate3d(0, 0,0);opacity:0;}
}
.fuRight{
  -webkit-backface-visibility: visible !important;
  backface-visibility: visible !important;
  -webkit-animation-name: fuRight;
  animation-name: fuRight;
}
.t-bg{position:absolute;display:none;width:100%;height:100%;top:0px;left:0px;background-color:#000;opacity:.86;z-index:6;}
.t-bg3{position:absolute;width:100%;height:100%;top:0px;left:0px;}
.hide{display:none;}
.rule, .user, .jtip{z-index:7;}
.rule-c1, .user-c1, .jtip-c1{position:absolute;}
.rule-t1, .user-t1, .jtip-t1{position:absolute;width:100%;height:100%;top:0px;left:0px;}
.p2-hc{z-index:9;}
.thezoom{zoom:.92;left:4%;}
@keyframes goDown{
  0%{transform: translate3d(0,-90%,0);opacity:1; }
  99%{transform: translate3d(0, 98%,0);opacity:1;}
  100%{transform: translate3d(0, 100%,0);opacity:0;}
}
.goDown{
  -webkit-backface-visibility: visible !important;
  backface-visibility: visible !important;
  -webkit-animation-name: goDown;
  animation-name: goDown;
  animation-duration: 8s;
  animation-fill-mode: both;
}
@keyframes p1Down{
  0%{transform: translate3d(0,85%,0);opacity:0; }
  10%{transform: translate3d(0,85%,0);opacity:1; }
  100%{transform: translate3d(0, 136%,0);opacity:0;}
}
.p1Down{
  -webkit-backface-visibility: visible !important;
  backface-visibility: visible !important;
  -webkit-animation-name: p1Down;
  animation-name: p1Down;
  animation-duration: 3s;
  animation-fill-mode: both;
  animation-iteration-count: infinite;
}
.p1-bao{position:absolute;width:100%;left:0px;z-index:7;}
.zi9{z-index:8;}
</style><script>var _hmt = _hmt || [];(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?808aed1b81301e5e2b8879efafe53a34";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();</script></head><body>
<div class="container">
	<div class="p1">
	  <div class="thebg">
		<img class="p-b" src="<?php echo $cdnUrl ?>img/p1.jpg?v=3">
		<img class="p1-duil simg animated3 swing2" src="<?php echo $cdnUrl ?>img/p1-duil.png">
		<img class="p1-duir simg animated4 swing2" src="<?php echo $cdnUrl ?>img/p1-duir.png">
		<img class="p1-hai simg animated4 pulse" src="<?php echo $cdnUrl ?>img/p1-hai.png">
		<img class="p1-bao p1Down hide" src="<?php echo $cdnUrl ?>img/p1-bao.png?v=8">
		<img class="p1-b1 simg animated2 tada" src="<?php echo $cdnUrl ?>img/p1-b1.png?v=3">
		
	  </div>
	  
	</div>
	<div class="p2 page">
	   <div class="thebg">
		<img class="p-b" src="<?php echo $cdnUrl ?>img/q/<?php echo $qian[0] ?>-b.jpg?v=3">
		<img class="p2-biao simg" src="<?php echo $cdnUrl ?>img/q/<?php echo $qian[0] ?>-qian.png">
		<img class="p2-yun1 simg" src="<?php echo $cdnUrl ?>img/yun1.png">
		<img class="p2-yun2 simg" src="<?php echo $cdnUrl ?>img/yun2.png">
		<img class="p2-bao simg" src="<?php echo $cdnUrl ?>img/p2-bao.png">
		
		<img class="p2-ren simg" src="<?php echo $cdnUrl ?>img/q/<?php echo $qian[0] ?>-ren.png">
		<img class="p2-ca simg" src="<?php echo $cdnUrl ?>img/p2-ca.png?v=3">
		<img class="p2-qr" src="<?php echo $cdnUrl ?>img/q/<?php echo $qian[0] ?>-qr.jpg?v=3">
		<img class="p2-hc simg" src="<?php echo $cdnUrl ?>img/p2-hc.png?v=3">
	   </div>
	</div>
	
	<div class="p3 page">
	  <div class="thebg">
	    <img class="p-b" src="<?php echo $cdnUrl ?>img/p3.jpg">
	    <img class="p3-bao goDown hide" src="<?php echo $cdnUrl ?>img/p3-bao.png">
<?php if (isset($_GET['c'])){ ?>
	    <img class="p3-ca simg" src="<?php echo $cdnUrl ?>img/p3-ca2.png">
<?php }else{ ?>
        <img class="p3-ca simg" src="<?php echo $cdnUrl ?>img/p3-ca.png">
<?php } ?>
	    <img class="p3-qr hide" src="<?php echo $cdnUrl ?>img/j/5-yh.jpg">
	    <img class="p3-hdsm simg" src="<?php echo $cdnUrl ?>img/p3-hdsm.png">
	    <img class="p3-home simg" src="<?php echo $cdnUrl ?>img/p3-home.png">
	    <img class="p3-wylj simg" src="<?php echo $cdnUrl ?>img/p3-wylj.png">
	    <div class="p3-hdsm zi9 simg"></div>
	    <div class="p3-home zi9 simg"></div>
	    <div class="p3-wylj zi9 simg"></div>
	  </div>
	</div>
	<img class="mu simg" src="<?php echo $cdnUrl ?>img/m.png">
	<div class="t-bg"></div>
	<div class="rule page">
	    <div class="t-bg3"></div>
	    <div class="rule-c1">
	       <img class="rule-t1 simg" src="<?php echo $cdnUrl ?>img/rule-1.png?v=5">
	       <div class="rule-close simg"></div>
	    </div>
	</div>
	<div class="jtip page">
	    <div class="t-bg3"></div>
	    <div class="jtip-c1">
	       <img class="jtip-t1 simg" src="<?php echo $cdnUrl ?>img/j/t5.png">
	       <div class="jtip-close simg"></div>
	    </div>
	</div>
	<div class="user page">
	    <div class="t-bg3"></div>
	    <div class="user-c1">
	       <img class="user-t1 simg" src="<?php echo $cdnUrl ?>img/u-1.png">
	       <input id="user-name" class="txt" name="name" type="text" placeholder="" />
	       <input id="user-phone" class="txt" name="phone" type="number" placeholder="" />
	       <input id="user-address" class="txt" name="phone" type="text" placeholder="" />
	       <div class="user-qd simg"></div>
	       <div class="user-close simg"></div>
	    </div>
	</div>
	
	<div class="js_dialog">
       <div class="weui-mask"></div>
       <div class="weui-dialog">
                <div class="weui-dialog__bd weui-msg"></div>
                <div class="weui-dialog__ft">
                    <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary weui-btn">知道了</a>
                </div>
        </div>
     </div>
     
     <div style="display:none;">
	    <audio id="bgm" preload="auto" autoplay loop="loop">
	        <source src='https://lin.mei94.com/hisense/js/bg.mp3?v=2' type="audio/mp3"> 
	    </audio>
	    <audio id="shm" preload="auto">
	        <source src='https://lin.mei94.com/hisense/js/shake.mp3?v=2' type="audio/mp3"> 
	    </audio>
	 </div> 
	
</div>
<script src="https://mat1.gtimg.com/libs/jquery2/2.1.4/jquery2.min.js"></script>
<script src="<?php echo $cdnUrl ?>js/pxloader-images.min.js"></script>
<script src="<?php echo $cdnUrl ?>js/shake.js"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
<script>
_h=h= Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
var sWidth = parseInt((window.innerWidth > 0) ? window.innerWidth : screen.width);
if(sWidth>750){sWidth=750;}
var _rate=(sWidth/750);
if(h<_rate*1206){h=_rate*1333;}
var _img=['p1.jpg'];
var loader = new PxLoader();
for(var i=0; i<_img.length; i++){loader.addImage('<?php echo $cdnUrl ?>img/'+_img[i]);}
loader.start();
var _qian=['hcbp','nffp','snyq','xxsc','yzjl','zsty'];
var _canShake=false;
var _bgm = document.getElementById('bgm');
var _shm = document.getElementById('shm');
var _isplay=false;
loader.addCompletionListener(function(e){
	<?php if ('localhost' == $_SERVER['HTTP_HOST']){ ?>
	   $(".p2").addClass("fade-in").css({"opacity":1});
	   $(".p2").show();
	   //$(".p3-bao").show();
	<?php }else{ ?>
	   $(".p1").addClass("fade-in").css({"opacity":1});
	<?php } ?>
	_canShake=true;
	_bgm.play();
	<?php if (!isset($_GET['c'])){ ?>
	_isplay=true;
	<?php } ?>
	document.addEventListener("WeixinJSBridgeReady", function () {
        _bgm.play();
        _shm.load();
    }, false);
	window.setTimeout(function(){
		$(".p1-bao").show();
		}, 600);
    
});
var _hasChou='no';
$(function(){
	$('body').on('touchmove',function(e){
		//e.preventDefault();
	});
	$('.container').width(sWidth).height(h);
	$('.thebg, .p-b, .p2-ren, .p3-bao').width(sWidth).height(_rate*1333);

	 
	$('.p1-bao').height(_rate*366).css({"top":_rate*660});
	
	$('.p1-b1').width(_rate*594).height(_rate*432).css({"top":_rate*876, "left":_rate*84});
	$('.p1-duil').width(_rate*146).height(_rate*881).css({"top":_rate*350, "left":_rate*24});
	$('.p1-duir').width(_rate*144).height(_rate*881).css({"top":_rate*350, "left":_rate*584});
	$('.p1-hai').width(_rate*510).height(_rate*638).css({"top":_rate*414, "left":_rate*144});
	$('.mu').width(_rate*146).height(_rate*121).css({"top":0, "left":_rate*604});
	$('.p2-biao').width(_rate*436).height(_rate*394).css({"top":_rate*433, "left":_rate*154});
	$('.p2-yun1').width(_rate*119).height(_rate*90).css({"top":_rate*576, "left":_rate*162});
	$('.p2-yun2').width(_rate*115).height(_rate*90).css({"top":_rate*576, "left":_rate*466});
	$('.p2-bao').width(_rate*158).height(_rate*132).css({"top":_rate*556, "left":_rate*296});
 
 
	$('.p2-ca').width(_rate*342).height(_rate*195).css({"top":_rate*1116, "left":_rate*36});
	$('.p2-hc').width(_rate*342).height(_rate*195).css({"top":_rate*1116, "left":_rate*376});
	$('.p3-hdsm').width(_rate*321).height(_rate*173).css({"top":_rate*1136, "left":_rate*46});
	$('.p3-home, .p3-ca, .p3-wylj').width(_rate*355).height(_rate*173).css({"top":_rate*1136, "left":_rate*376});

	var _tmpTop= (h-_rate*1010)/2;
	$('.rule-c1, .user-c1, .jtip-c1').width(_rate*597).height(_rate*996).css({"top":_tmpTop, "left":_rate*76});
	$('.rule-close, .user-close, .jtip-close').width(_rate*260).height(_rate*130).css({"top":_rate*220, "left":_rate*170});
	 
	$('#user-name').width(_rate*226).height(_rate*70).css({"top":_rate*396, "left":_rate*216}); //, 'line-height':_rate*70+'px'
	$('#user-phone').width(_rate*226).height(_rate*70).css({"top":_rate*476, "left":_rate*216});
	$('#user-address').width(_rate*226).height(_rate*70).css({"top":_rate*556, "left":_rate*216});
	$('.user-qd').width(_rate*286).height(_rate*100).css({"top":_rate*644, "left":_rate*152});

	console.log(h);
	console.log(_rate*1333);

	<?php if (isset($_GET['c'])){ ?>
	_isplay=false;
	$('.mu').attr("src", "<?php echo $cdnUrl ?>img/m_1.png");
    _bgm.pause();
   
	$('.p1-b1').click(function(){
        $(".p1").fadeOut();
        $(".p2").fadeIn();
	});
	window.setTimeout(function(){
		$(".p1").fadeOut();
        $(".p2").fadeIn();
		}, 5000);
	<?php } ?>
	//.thezoom
	if(h > _rate*1333){
		   var _cha= (h - _rate*1333)/2;
		   if(_cha > 0){
		      $('.thebg').css({"top":_cha});
		   }   
	} 
	if(h < _rate*1336){
       $(".p1, .p2, .p3").addClass("thezoom");

    }  
	 
	$('.p2-hc').click(function(){
		$.post("api/?c=chou", {id:1}, function(data){
			_hasChou=data.has;
			$('.p3-hdsm, .p3-home, .p3-ca, .p3-qr, .p3-wylj').hide();
			if('work' == data.status){
				
				if(5 == data.j){
				  $('.p3-hdsm, .p3-ca, .p3-qr').show();	
                  $(".p3 .p-b").attr("src","./img/j/"+data.n+'.jpg');
                  $(".rule-t1").attr("src","./img/rule-2.png?v=5");
			    }
				if(4 == data.j || 3 == data.j || 2 == data.j || 1 == data.j){
					  $('.p3-hdsm, .p3-wylj').show();	
	                  $(".p3 .p-b").attr("src","./img/j/"+data.n+'.jpg');
	                  $(".rule-t1").attr("src","./img/rule-1.png?v=5");
	                  $('.p3-wylj').click(function(){
		                  $(".t-bg, .user").fadeIn();
	                  });
				}

				if("yes" == _hasChou){
              	  $(".jtip-t1").attr("src","./img/j/t"+data.j+".png");
              	  $(".t-bg, .jtip").fadeIn();
	              	$('#user-name').val(data.name);
	            	$('#user-phone').val(data.phone);
	            	$('#user-address').val(data.dz);
            	
	            }else{
	            	$(".p3-bao").show();
		        }
				
				$(".p2").fadeOut();
				$(".p3").fadeIn();
		    }else{
		    	$('.p3-hdsm, .p3-home').show();
		    	$(".p2").fadeOut();
				$(".p3").fadeIn();
		    }
			
	        }, "json");
    });
	$('.p3-home').click(function(){
		_canShake=true;
		$(".p3").fadeOut();
		$(".p1").fadeIn();
    });
	$('.p3-hdsm').click(function(){
		$(".t-bg, .rule").fadeIn();
    });
	$('.rule-close').click(function(){
		$(".t-bg, .rule").fadeOut();
    });
	$('.t-bg3, .user-close, .jtip-close').click(function(){
		$(".t-bg, .rule, .user, .jtip").fadeOut();
    });
	$('.jtip-close').click(function(){
		$(".p3-bao").show();
    });

	
	
	$('.user-qd').click(function(){
		var _name=$('#user-name').val();
		var _phone=$('#user-phone').val();
		var _dz=$('#user-address').val();
		if('' == _name){$(".weui-msg").html("请输入姓名");$(".js_dialog").show();return;}
		if('' == _phone){$(".weui-msg").html("请输入联系方式");$(".js_dialog").show();return;}
		if('' == _dz){$(".weui-msg").html("请输入邮寄地址");$(".js_dialog").show();return;}
		$.post("api/?c=uinfo", {name:_name,phone:_phone,dz:_dz}, function(data){
			$(".weui-msg").html("您已填写成功");$(".js_dialog").show();
			window.setTimeout(function(){
				$(".js_dialog").hide();
				$(".user, .t-bg").fadeOut();
				}, 1000);
			
	        }, "json");
    });  
   
	//$('.p1-t2').width(_rate*316).height(_rate*308).css({"top":_rate*996, "left":_rate*212});

    var myShakeEvent = new Shake({
        threshold: 9
    });
    myShakeEvent.start();
    window.addEventListener('shake', shakeEventDidOccur, false);
    function shakeEventDidOccur () {
        if(_canShake){
        	_canShake=false;
            window.setTimeout(function(){
            	$(".p1").fadeOut(1000);
                window.setTimeout(function(){
                	$(".p2").show().addClass("animatedf flipInY");
                  }, 800);
                window.setTimeout(function(){
                	$(".p2-yun1").show().addClass("animated3 fuLeft");
                    $(".p2-yun2").show().addClass("animated3 fuRight");
                    $(".p2-bao").show().addClass("animated4 tada");
                    $(".p2-biao").show().addClass("animated4 pulse");
                  }, 3000);
                }, 1600);
             _shm.play();
             window.setTimeout(function(){
            	 _shm.pause();
            	 
                 }, 1900);
        }
    }

  
    
    $(".js_dialog").click(function(){
        $(".js_dialog").hide();
	 });

    $('.mu').click(function(){
        if(_isplay){
        	_isplay=false;
        	$('.mu').attr("src", "<?php echo $cdnUrl ?>img/m_1.png");
            _bgm.pause();
        }else{
        	_isplay=true;
            _bgm.play();
            $('.mu').attr("src", "<?php echo $cdnUrl ?>img/m.png");
        }
        
	 });


    wx.config({
        appId: '<?php echo $signPackage["appId"];?>',timestamp: <?php echo $signPackage["timestamp"];?>,
        nonceStr: '<?php echo $signPackage["nonceStr"];?>',signature: '<?php echo $signPackage["signature"];?>',
        jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage','onMenuShareQQ','showMenuItems','showOptionMenu']
    });
    wx.ready(function () {
    		var _title='2020来咯！快来抽你的新年福签';
    		var _desc='好礼狂欢送不停，大金元宝等你拿';
    		var _link='http://mei94.com/hisense/';
    		var _imgUrl='http://mei94.com/hisense/img/6.jpg';
    			wx.onMenuShareTimeline({title: _title, link: _link, imgUrl: _imgUrl,success: function () {
    			},cancel: function () { 
    			}});
    			wx.onMenuShareAppMessage({ title: _title, desc: _desc,link: _link,imgUrl: _imgUrl, type: '', dataUrl: '', success: function () {
    			},cancel: function () { 
    			}});
    });
	 
	
});
</script>
</body></html>